<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>渐变文字</title>
    <style>
        body {
            background-color: black;
        }

        h1 {
            margin: 200px auto;
            font-size: 100px;
            text-align: center;
            background-image: linear-gradient(green, orange);
            -webkit-background-clip: text;
            color: transparent;
        }
    </style>
</head>

<body>
    <h1>这是一个渐变文字</h1>
</body>

</html>